]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
capsLockWarning: Mark as not visible to a11y tree when hidden
authorLukáš Tyrychtr <ltyrycht@redhat.com>
Tue, 25 Nov 2025 14:26:09 +0000 (15:26 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 1 Dec 2025 09:42:07 +0000 (09:42 +0000)
We're animating it away, but not for the a11y tree.

This fixes it, so the caps lock warning is not read regardless of the state
of the key.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3981>

js/ui/shellEntry.js

index ddbd4d47be69ad1a24507f0c02cd7a5c7369ae21..defbf87125ff81403c4ea6e402f902f7b82056d5 100644 (file)
@@ -1,3 +1,4 @@
+import Atk from 'gi://Atk';
 import Clutter from 'gi://Clutter';
 import GObject from 'gi://GObject';
 import Pango from 'gi://Pango';
@@ -197,6 +198,14 @@ class CapsLockWarning extends St.Label {
         const [, height] = this.get_preferred_height(-1);
         this.natural_height_set = naturalHeightSet;
 
+        if (capsLockOn) {
+            this.add_accessible_state(Atk.StateType.SHOWING);
+            this.add_accessible_state(Atk.StateType.VISIBLE);
+        } else {
+            this.remove_accessible_state(Atk.StateType.SHOWING);
+            this.remove_accessible_state(Atk.StateType.VISIBLE);
+        }
+
         this.ease({
             height: capsLockOn ? height : 0,
             opacity: capsLockOn ? 255 : 0,